﻿<script type="text/javascript" src="/js/register.js" language="javascript" ></script>
<?php 
if(isset($_SESSION['config_template']))
{
	if($_SESSION['config_template']=='layoutmain_web1')
	{
		?>
		<style type="text/css">
			.labeltxt {font-weight:bold;}
			.star {color:red;}
			.label {width:25%; height:30px;}
			.td_star {width:2%; height:30px;}
			.txtInput {width:35%; height:30px;}
			.outputError {width:38%; height:30px; color:red;}
			.button_check {height:25px; padding-left:5px; padding-right:5px;}
		</style>
		<div class="my-account">
							<!-- start content -->
								<link rel="stylesheet" type="text/css" href="css/register.css" media="all">
								<div class="page-title">
									<h1><?php echo $this->text_title_register;?></h1>
								</div>
								<form id="frmRegister" name="frmRegister" action="" method="POST" enctype="multipart/form-data" onsubmit="return checkinput()">
								<div class="fieldset" style="height:auto !important;">
									<h2 class="legend"><?php echo $this->text_lguser;?></h2>
									<table width="100%">
		                            	<tr>
		                                	<td class="label"><p class="labeltxt"><?php echo $this->text_username;?></p></td>
		                                    <td class="td_star"><span class="star">*</span></td>
		                                    <td class="txtInput">
		                                    	<input type="text" name="txtUsername" id="txtUsername" size="20%" maxlength="30" class="input-text" value="<?php if(isset($this->username)) echo $this->username; ?>" />
		                                    	<input type="button" id="checkUsername" name="checkUsername" value="Kiểm tra" onclick="validateUser()" class="button_check"/>
											</td>
		                                    <td class="outputError" id="alertUser">
		                                    	
		                                    </td>
		                        		</tr>
		                                <tr>
		                                	<td class="label"><p class="labeltxt"><?php echo $this->text_pass;?></p></td>
		                                    <td class="td_star"><span class="star">*</span></td>
		                                    <td class="txtInput">
		                                    	<input type="password" name="txtPassword" id="txtPassword" size="35%" maxlength="30" class="input-text"/>
		                                    </td>
		                                    <td class="outputError" id="alertPassword">
		                                    </td>
		                                </tr>
		                                <tr>
		                                	<td class="label"><p class="labeltxt"><?php echo $this->text_confirmpass;?></p></td>
		                                    <td class="td_star"><span class="star">*</span></td>
		                                    <td class="txtInput">
		                                    	<input type="password" name="txtConfirmPassword" id="txtConfirmPassword" size="35%" maxlength="30" class="input-text"/>
		                                    </td>
		                                    <td class="outputError" id="alertConfirmPass">
		                                    </td>
		                                </tr>
		                        	</table>
								</div>
								<div class="fieldset" style="height:auto !important;">
										<h2 class="legend"><?php echo $this->text_lgprofile;?></h2>
										<table width="100%">
			                            	<tr>
			                                	<td class="label"><p class="labeltxt"><?php echo $this->text_name;?></p></td>
			                                    <td class="td_star"><span class="star">*</span></td>
			                                    <td class="txtInput">
			                                    	<input type="text" name="txtFullName" id="txtFullName" size="35%" maxlength="30" class="input-text" value="<?php if(isset($this->fullname)) echo $this->fullname; ?>" />
			                                    </td>
			                                    <td class="outputError" id="alertFullName">
			                                    </td>
			                        		</tr>
			                        		<tr>
			                                	<td class="label"><p class="labeltxt"><?php echo $this->text_email;?></p></td>
			                                    <td class="td_star"><span class="star">*</span></td>
			                                    <td class="txtInput">
			                                    	<input type="text" name="txtEmail" id="txtEmail" size="35%" maxlength="120" class="input-text" value="<?php if(isset($this->email)) echo $this->email; ?>" />
			                                    </td>
			                                    <td class="outputError" id="alertEmail">
			                                    	<?php if(isset($this->emailError)) echo $this->error_validuser3;?>
			                                    </td>
			                        		</tr>
			                                <tr>
			                                	<td class="label"><p class="labeltxt"><?php echo $this->text_comfirmemail;?></p></td>
			                                    <td class="td_star"><span class="star">*</span></td>
			                                    <td class="txtInput">
			                                    	<input type="text" name="txtConfirmEmail" id="txtConfirmEmail" size="35%" maxlength="120" class="input-text" value="<?php if(isset($this->email)) echo $this->email; ?>" />
			                                    </td>
			                                    <td class="outputError" id="alertConfirmEmail">
			                                    </td>
			                        		</tr>
			                                <tr>
			                                	<td class="label"><p class="labeltxt"><?php echo $this->text_sex;?></p></td>
			                                    <td class="td_star"><span class="star">*</span></td>
			                                    <td class="txtInput">
			                                    	<select id="sltSex" name="sltSex" tabindex="0" >
			                                         		<option <?php if(!isset($this->sex)) echo "selected='selected'"?> value="-1"><?php echo $this->text_select;?></option>
			                                                <option <?php if(isset($this->sex) && $this->sex == 1) echo "selected='selected'"?> value="1"><?php echo $this->text_sex1;?></option>
			                                                <option <?php if(isset($this->sex) && $this->sex == 0) echo "selected='selected'"?> value="0"><?php echo $this->text_sex0;?></option>
			                                         </select>
			                                    </td>
			                                    <td class="outputError" id="alertSex">
			                                    </td>
			                                </tr>
			                                <tr>
			                                	<td class="label"><p class="labeltxt"><?php echo $this->text_birthday;?></p></td>
			                                    <td class="td_star"><span class="star">*</span></td>
			                                    <td class="txtInput">
			                                    	<select id="dBirthday" name="dBirthday" tabindex="0" class="select">
			                                         			<option <?php if(!isset($this->dbirthday)) echo "selected='selected'"?> value="0"><?php echo $this->text_day;?></option>
			                                         			<?php if(isset($this->dbirthday) && $this->dbirthday>0) echo "<option selected='selected' value='{$this->dbirthday}'>{$this->dbirthday}</option>"?>
			                                                     <option value="1">1</option>
			                                                     <option value="2">2</option>
			                                                     <option value="3">3</option>
			                                                     <option value="4">4</option>
			                                                     <option value="5">5</option>
			                                                     <option value="6">6</option>
			                                                     <option value="7">7</option>
			                                                     <option value="8">8</option>
			                                                     <option value="9">9</option>
			                                                     <option value="10">10</option>
			                                                     <option value="11">11</option>
			                                                     <option value="12">12</option>
			                                                     <option value="13">13</option>
			                                                     <option value="14">14</option>
			                                                     <option value="15">15</option>
			                                                     <option value="16">16</option>
			                                                     <option value="17">17</option>
			                                                     <option value="18">18</option>
			                                                     <option value="19">19</option>
			                                                     <option value="20">20</option>
			                                                     <option value="21">21</option>
			                                                     <option value="22">22</option>
			                                                     <option value="23">23</option>
			                                                     <option value="24">24</option>
			                                                     <option value="25">25</option>
			                                                     <option value="26">26</option>
			                                                     <option value="27">27</option>
			                                                     <option value="28">28</option>
			                                                     <option value="29">29</option>
			                                                     <option value="30">30</option>
			                                                     <option value="31">31</option>
			                                         </select>
			                                         <select id="mBirthday" name="mBirthday" tabindex="0" >
			                                         		<option <?php if(!isset($this->mbirthday)) echo "selected='selected'"?> value="0"><?php echo $this->text_month;?></option>
			                                         		<?php if(isset($this->mbirthday) && $this->mbirthday>0) echo "<option selected='selected' value='{$this->mbirthday}'>{$this->mbirthday}</option>"?>
			                                                 <option value="1">1</option>
			                                                 <option value="2">2</option>
			                                                 <option value="3">3</option>
			                                                 <option value="4">4</option>
			                                                 <option value="5">5</option>
			                                                 <option value="6">6</option>
			                                                 <option value="7">7</option>
			                                                 <option value="8">8</option>
			                                                 <option value="9">9</option>
			                                                 <option value="10">10</option>
			                                                 <option value="11">11</option>
			                                                 <option value="12">12</option>
			                                         </select>
			                                         <select id="yBirthday" name="yBirthday" tabindex="0" class="select">
			                                         			<option <?php if(!isset($this->ybirthday)) echo "selected='selected'"?> value="0"><?php echo $this->text_year;?></option>
			                                         			<?php if(isset($this->ybirthday) && $this->ybirthday>0) echo "<option selected='selected' value='{$this->ybirthday}'>{$this->ybirthday}</option>"?>
			                                                     <option value="2011">2011</option>
			                                                     <option value="2010">2010</option>
			                                                     <option value="2009">2009</option>
			                                                     <option value="2008">2008</option>
			                                                     <option value="2007">2007</option>
			                                                     <option value="2006">2006</option>
			                                                     <option value="2005">2005</option>
			                                                     <option value="2004">2004</option>
			                                                     <option value="2003">2003</option>
			                                                     <option value="2002">2002</option>
			                                                     <option value="2001">2001</option>
			                                                     <option value="2000">2000</option>
			                                                     <option value="1999">1999</option>
			                                                     <option value="1998">1998</option>
			                                                     <option value="1997">1997</option>
			                                                     <option value="1996">1996</option>
			                                                     <option value="1995">1995</option>
			                                                     <option value="1994">1994</option>
			                                                     <option value="1993">1993</option>
			                                                     <option value="1992">1992</option>
			                                                     <option value="1991">1991</option>
			                                                     <option value="1990">1990</option>
			                                                     <option value="1989">1989</option>
			                                                     <option value="1988">1988</option>
			                                                     <option value="1987">1987</option>
			                                                     <option value="1986">1986</option>
			                                                     <option value="1985">1985</option>
			                                                     <option value="1984">1984</option>
			                                                     <option value="1983">1983</option>
			                                                     <option value="1982">1982</option>
			                                                     <option value="1981">1981</option>
			                                                     <option value="1980">1980</option>
			                                                     <option value="1979">1979</option>
			                                                     <option value="1978">1978</option>
			                                                     <option value="1977">1977</option>
			                                                     <option value="1976">1976</option>
			                                                     <option value="1975">1975</option>
			                                                     <option value="1974">1974</option>
			                                                     <option value="1973">1973</option>
			                                                     <option value="1972">1972</option>
			                                                     <option value="1971">1971</option>
			                                                     <option value="1970">1970</option>
			                                                     <option value="1969">1969</option>
			                                                     <option value="1968">1968</option>
			                                                     <option value="1967">1967</option>
			                                                     <option value="1966">1966</option>
			                                                     <option value="1965">1965</option>
			                                                     <option value="1964">1964</option>
			                                                     <option value="1963">1963</option>
			                                                     <option value="1962">1962</option>
			                                                     <option value="1961">1961</option>
			                                                     <option value="1960">1960</option>
			                                                     <option value="1959">1959</option>
			                                                     <option value="1958">1958</option>
			                                                     <option value="1957">1957</option>
			                                                     <option value="1956">1956</option>
			                                                     <option value="1955">1955</option>
			                                                     <option value="1954">1954</option>
			                                                     <option value="1953">1953</option>
			                                                     <option value="1952">1952</option>
			                                                     <option value="1951">1951</option>
			                                                     <option value="1950">1950</option>
			                                                     <option value="1949">1949</option>
			                                                     <option value="1948">1948</option>
			                                                     <option value="1947">1947</option>
			                                                     <option value="1946">1946</option>
			                                                     <option value="1945">1945</option>
			                                                     <option value="1944">1944</option>
			                                                     <option value="1943">1943</option>
			                                                     <option value="1942">1942</option>
			                                                     <option value="1941">1941</option>
			                                                     <option value="1940">1940</option>
			                                                     <option value="1939">1939</option>
			                                                     <option value="1938">1938</option>
			                                                     <option value="1937">1937</option>
			                                                     <option value="1936">1936</option>
			                                                     <option value="1935">1935</option>
			                                                     <option value="1934">1934</option>
			                                                     <option value="1933">1933</option>
			                                                     <option value="1932">1932</option>
			                                                     <option value="1931">1931</option>
			                                                     <option value="1930">1930</option>
			                                                     <option value="1929">1929</option>
			                                                     <option value="1928">1928</option>
			                                                     <option value="1927">1927</option>
			                                                     <option value="1926">1926</option>
			                                                     <option value="1925">1925</option>
			                                                     <option value="1924">1924</option>
			                                                     <option value="1923">1923</option>
			                                                     <option value="1922">1922</option>
			                                                     <option value="1921">1921</option>
			                                                     <option value="1920">1920</option>
			                                                     <option value="1919">1919</option>
			                                                     <option value="1918">1918</option>
			                                                     <option value="1917">1917</option>
			                                                     <option value="1916">1916</option>
			                                                     <option value="1915">1915</option>
			                                                     <option value="1914">1914</option>
			                                                     <option value="1913">1913</option>
			                                                     <option value="1912">1912</option>
			                                                     <option value="1911">1911</option>
			                                                     <option value="1910">1910</option>
			                                                     <option value="1909">1909</option>
			                                                     <option value="1908">1908</option>
			                                                     <option value="1907">1907</option>
			                                                     <option value="1906">1906</option>
			                                                     <option value="1905">1905</option>
			                                                     <option value="1904">1904</option>
			                                                     <option value="1903">1903</option>
			                                                     <option value="1902">1902</option>
			                                                     <option value="1901">1901</option>
			                                                     <option value="1900">1900</option>
			                                          </select>
			                                    </td>
			                                    <td class="outputError" id="alertBirthday">
			                                    </td>
			                                </tr>
			                                <tr>
			                                	<td class="label"><p class="labeltxt"><?php echo $this->text_address;?></p></td>
			                                	<td class="td_star"></td>
			                                    <td class="txtInput">
			                                    	<input type="text" name="txtAddress" id="txtAddress" size="35%" maxlength="50" class="input-text" value="<?php if(isset($this->address)) echo $this->address; ?>" />
			                                    </td>
			                                    <td class="outputError" id="alertAddress">
			                                    </td>
			                                </tr>
			                                <tr>
			                                	<td class="label"><p class="labeltxt"><?php echo $this->text_career;?></p></td>
			                                    <td></td>
			                                    <td class="txtInput">
			                                    	<input type="text" name="txtCareer" id="txtCareer" size="35%" maxlength="30" class="input-text" value="<?php if(isset($this->career)) echo $this->career; ?>" />
			                                    </td>
			                                    <td class="outputError">
			                                    </td>
			                                </tr>
			                        	</table>
								</div>
								<div class="fieldset" style="height:auto !important;">
									<h2 class="legend"><?php echo $this->text_lgcaptcha;?></h2>
									<table width="100%">
		                            	<tr>
		                                	<td class="label"><p class="labeltxt"><?php echo $this->text_captcha;?></p></td>
		                                	<td></td>
		                                    <td class="txtInput">
		                                    	<div style="width:160px; height:50px; float:left;">
		                                    	<a onclick="captcha()" style="cursor:pointer"><img id="captchaShow" src="<?php echo "/captcha/images/".$this->captchaID.".jpg"?>"/></a>
		                                    	</div><div style="width:28px; height:30px; float:left; margin-top:10px; margin-left:10px;">
		                                    	<input type="button" id="changeCaptcha" name="changeCaptcha" value="" onclick="captcha()" style="background:url(/images/ResetButton.png); width:28px; height:30px; border:0; cursor:pointer"/>
		                                    	</div>
		                                    </td>
		                                    <td class="outputError">
		                                    	<input type="hidden" id="hdnCaptcha" name="hdnCaptcha" value="<?php echo $this->captchaID?>" />
		                                    </td>
		                                </tr>
		                                <tr>
		                                	<td class="label"><p class="labeltxt"><?php echo $this->text_inputcaptcha;?></p></td>
		                                    <td class="td_star"><span class="star">*</span></td>
		                                    <td class="txtInput">
		                                    	<input type="text" name="txtCaptcha" id="txtCaptcha" size="35%" maxlength="20" class="input-text" />
		                                    </td>
		                                    <td class="outputError" id="alertCaptcha">
		                                    	<?php if(isset($this->captchaError)) echo $this->error_pass6;?>
		                                    </td>
		                                </tr>
		                            </table>
								</div>
								<div class="buttons-set">
									<p class="required"><?php echo $this->text_tip;?></p>
									<p class="back-link"><a href="/"><small>« </small><?php echo $this->text_cancel;?></a></p>
									<button type="submit" title="<?php echo $this->text_submit;?>" class="button"><span><span><?php echo $this->text_submit;?></span></span></button>
								</div>
								</form>
								<!-- end content -->
						</div>
		<?php 
	}
	else 
	{
		if($_SESSION['config_template']=='layoutmain_web2')
		{?>
			<style type="text/css">
			.labeltxt {font-weight:bold;}
			.star {color:red;}
			.label {width:25%; height:30px;}
			.td_star {width:2%; height:30px;}
			.txtInput {width:35%; height:30px;}
			.outputError {width:38%; height:30px; color:red;}
			.button_check {height:25px; padding-left:5px; padding-right:5px;}
		</style>
			<!-- start center -->
					<div id="main" class="col-main">
						<div class="my-account">
							<!-- start content -->
								<link rel="stylesheet" type="text/css" href="css/register.css" media="all">
								<div class="page-title">
									<h1><?php echo $this->text_title_register;?></h1>
								</div>
								<form id="frmRegister" name="frmRegister" action="" method="POST" enctype="multipart/form-data" onsubmit="return checkinput()">
								<div class="fieldset" style="height:auto !important;">
									<h2 class="legend"><?php echo $this->text_lguser;?></h2>
									<table width="100%">
		                            	<tr>
		                                	<td class="label"><p class="labeltxt"><?php echo $this->text_username;?></p></td>
		                                    <td class="td_star"><span class="star">*</span></td>
		                                    <td class="txtInput">
		                                    	<input type="text" name="txtUsername" id="txtUsername" size="20%" maxlength="30" class="input-text" value="<?php if(isset($this->username)) echo $this->username; ?>" />
		                                    	<input type="button" id="checkUsername" name="checkUsername" value="Kiểm tra" onclick="validateUser()" class="button_check"/>
											</td>
		                                    <td class="outputError" id="alertUser">
		                                    	<?php //if(isset($this->userError))echo $this->error_validuser1;?>
		                                    </td>
		                        		</tr>
		                                <tr>
		                                	<td class="label"><p class="labeltxt"><?php echo $this->text_pass;?></p></td>
		                                    <td class="td_star"><span class="star">*</span></td>
		                                    <td class="txtInput">
		                                    	<input type="password" name="txtPassword" id="txtPassword" size="35%" maxlength="30" class="input-text"/>
		                                    </td>
		                                    <td class="outputError" id="alertPassword">
		                                    </td>
		                                </tr>
		                                <tr>
		                                	<td class="label"><p class="labeltxt"><?php echo $this->text_confirmpass;?></p></td>
		                                    <td class="td_star"><span class="star">*</span></td>
		                                    <td class="txtInput">
		                                    	<input type="password" name="txtConfirmPassword" id="txtConfirmPassword" size="35%" maxlength="30" class="input-text"/>
		                                    </td>
		                                    <td class="outputError" id="alertConfirmPass">
		                                    </td>
		                                </tr>
		                        	</table>
								</div>
								<div class="fieldset" style="height:auto !important;">
										<h2 class="legend"><?php echo $this->text_lgprofile;?></h2>
										<table width="100%">
			                            	<tr>
			                                	<td class="label"><p class="labeltxt"><?php echo $this->text_name;?></p></td>
			                                    <td class="td_star"><span class="star">*</span></td>
			                                    <td class="txtInput">
			                                    	<input type="text" name="txtFullName" id="txtFullName" size="35%" maxlength="30" class="input-text" value="<?php if(isset($this->fullname)) echo $this->fullname; ?>" />
			                                    </td>
			                                    <td class="outputError" id="alertFullName">
			                                    </td>
			                        		</tr>
			                        		<tr>
			                                	<td class="label"><p class="labeltxt"><?php echo $this->text_email;?></p></td>
			                                    <td class="td_star"><span class="star">*</span></td>
			                                    <td class="txtInput">
			                                    	<input type="text" name="txtEmail" id="txtEmail" size="35%" maxlength="120" class="input-text" value="<?php if(isset($this->email)) echo $this->email; ?>" />
			                                    </td>
			                                    <td class="outputError" id="alertEmail">
			                                    	<?php if(isset($this->emailError)) echo $this->error_validuser3;?>
			                                    </td>
			                        		</tr>
			                                <tr>
			                                	<td class="label"><p class="labeltxt"><?php echo $this->text_comfirmemail;?></p></td>
			                                    <td class="td_star"><span class="star">*</span></td>
			                                    <td class="txtInput">
			                                    	<input type="text" name="txtConfirmEmail" id="txtConfirmEmail" size="35%" maxlength="120" class="input-text" value="<?php if(isset($this->email)) echo $this->email; ?>" />
			                                    </td>
			                                    <td class="outputError" id="alertConfirmEmail">
			                                    </td>
			                        		</tr>
			                                <tr>
			                                	<td class="label"><p class="labeltxt"><?php echo $this->text_sex;?></p></td>
			                                    <td class="td_star"><span class="star">*</span></td>
			                                    <td class="txtInput">
			                                    	<select id="sltSex" name="sltSex" tabindex="0" >
			                                         		<option <?php if(!isset($this->sex)) echo "selected='selected'"?> value="-1"><?php echo $this->text_select;?></option>
			                                                <option <?php if(isset($this->sex) && $this->sex == 1) echo "selected='selected'"?> value="1"><?php echo $this->text_sex1;?></option>
			                                                <option <?php if(isset($this->sex) && $this->sex == 0) echo "selected='selected'"?> value="0"><?php echo $this->text_sex0;?></option>
			                                         </select>
			                                    </td>
			                                    <td class="outputError" id="alertSex">
			                                    </td>
			                                </tr>
			                                <tr>
			                                	<td class="label"><p class="labeltxt"><?php echo $this->text_birthday;?></p></td>
			                                    <td class="td_star"><span class="star">*</span></td>
			                                    <td class="txtInput">
			                                    	<select id="dBirthday" name="dBirthday" tabindex="0" class="select">
			                                         			<option <?php if(!isset($this->dbirthday)) echo "selected='selected'"?> value="0"><?php echo $this->text_day;?></option>
			                                         			<?php if(isset($this->dbirthday) && $this->dbirthday>0) echo "<option selected='selected' value='{$this->dbirthday}'>{$this->dbirthday}</option>"?>
			                                                     <option value="1">1</option>
			                                                     <option value="2">2</option>
			                                                     <option value="3">3</option>
			                                                     <option value="4">4</option>
			                                                     <option value="5">5</option>
			                                                     <option value="6">6</option>
			                                                     <option value="7">7</option>
			                                                     <option value="8">8</option>
			                                                     <option value="9">9</option>
			                                                     <option value="10">10</option>
			                                                     <option value="11">11</option>
			                                                     <option value="12">12</option>
			                                                     <option value="13">13</option>
			                                                     <option value="14">14</option>
			                                                     <option value="15">15</option>
			                                                     <option value="16">16</option>
			                                                     <option value="17">17</option>
			                                                     <option value="18">18</option>
			                                                     <option value="19">19</option>
			                                                     <option value="20">20</option>
			                                                     <option value="21">21</option>
			                                                     <option value="22">22</option>
			                                                     <option value="23">23</option>
			                                                     <option value="24">24</option>
			                                                     <option value="25">25</option>
			                                                     <option value="26">26</option>
			                                                     <option value="27">27</option>
			                                                     <option value="28">28</option>
			                                                     <option value="29">29</option>
			                                                     <option value="30">30</option>
			                                                     <option value="31">31</option>
			                                         </select>
			                                         <select id="mBirthday" name="mBirthday" tabindex="0" >
			                                         		<option <?php if(!isset($this->mbirthday)) echo "selected='selected'"?> value="0"><?php echo $this->text_month;?></option>
			                                         		<?php if(isset($this->mbirthday) && $this->mbirthday>0) echo "<option selected='selected' value='{$this->mbirthday}'>{$this->mbirthday}</option>"?>
			                                                 <option value="1">1</option>
			                                                 <option value="2">2</option>
			                                                 <option value="3">3</option>
			                                                 <option value="4">4</option>
			                                                 <option value="5">5</option>
			                                                 <option value="6">6</option>
			                                                 <option value="7">7</option>
			                                                 <option value="8">8</option>
			                                                 <option value="9">9</option>
			                                                 <option value="10">10</option>
			                                                 <option value="11">11</option>
			                                                 <option value="12">12</option>
			                                         </select>
			                                         <select id="yBirthday" name="yBirthday" tabindex="0" class="select">
			                                         			<option <?php if(!isset($this->ybirthday)) echo "selected='selected'"?> value="0"><?php echo $this->text_year;?></option>
			                                         			<?php if(isset($this->ybirthday) && $this->ybirthday>0) echo "<option selected='selected' value='{$this->ybirthday}'>{$this->ybirthday}</option>"?>
			                                                     <option value="2011">2011</option>
			                                                     <option value="2010">2010</option>
			                                                     <option value="2009">2009</option>
			                                                     <option value="2008">2008</option>
			                                                     <option value="2007">2007</option>
			                                                     <option value="2006">2006</option>
			                                                     <option value="2005">2005</option>
			                                                     <option value="2004">2004</option>
			                                                     <option value="2003">2003</option>
			                                                     <option value="2002">2002</option>
			                                                     <option value="2001">2001</option>
			                                                     <option value="2000">2000</option>
			                                                     <option value="1999">1999</option>
			                                                     <option value="1998">1998</option>
			                                                     <option value="1997">1997</option>
			                                                     <option value="1996">1996</option>
			                                                     <option value="1995">1995</option>
			                                                     <option value="1994">1994</option>
			                                                     <option value="1993">1993</option>
			                                                     <option value="1992">1992</option>
			                                                     <option value="1991">1991</option>
			                                                     <option value="1990">1990</option>
			                                                     <option value="1989">1989</option>
			                                                     <option value="1988">1988</option>
			                                                     <option value="1987">1987</option>
			                                                     <option value="1986">1986</option>
			                                                     <option value="1985">1985</option>
			                                                     <option value="1984">1984</option>
			                                                     <option value="1983">1983</option>
			                                                     <option value="1982">1982</option>
			                                                     <option value="1981">1981</option>
			                                                     <option value="1980">1980</option>
			                                                     <option value="1979">1979</option>
			                                                     <option value="1978">1978</option>
			                                                     <option value="1977">1977</option>
			                                                     <option value="1976">1976</option>
			                                                     <option value="1975">1975</option>
			                                                     <option value="1974">1974</option>
			                                                     <option value="1973">1973</option>
			                                                     <option value="1972">1972</option>
			                                                     <option value="1971">1971</option>
			                                                     <option value="1970">1970</option>
			                                                     <option value="1969">1969</option>
			                                                     <option value="1968">1968</option>
			                                                     <option value="1967">1967</option>
			                                                     <option value="1966">1966</option>
			                                                     <option value="1965">1965</option>
			                                                     <option value="1964">1964</option>
			                                                     <option value="1963">1963</option>
			                                                     <option value="1962">1962</option>
			                                                     <option value="1961">1961</option>
			                                                     <option value="1960">1960</option>
			                                                     <option value="1959">1959</option>
			                                                     <option value="1958">1958</option>
			                                                     <option value="1957">1957</option>
			                                                     <option value="1956">1956</option>
			                                                     <option value="1955">1955</option>
			                                                     <option value="1954">1954</option>
			                                                     <option value="1953">1953</option>
			                                                     <option value="1952">1952</option>
			                                                     <option value="1951">1951</option>
			                                                     <option value="1950">1950</option>
			                                                     <option value="1949">1949</option>
			                                                     <option value="1948">1948</option>
			                                                     <option value="1947">1947</option>
			                                                     <option value="1946">1946</option>
			                                                     <option value="1945">1945</option>
			                                                     <option value="1944">1944</option>
			                                                     <option value="1943">1943</option>
			                                                     <option value="1942">1942</option>
			                                                     <option value="1941">1941</option>
			                                                     <option value="1940">1940</option>
			                                                     <option value="1939">1939</option>
			                                                     <option value="1938">1938</option>
			                                                     <option value="1937">1937</option>
			                                                     <option value="1936">1936</option>
			                                                     <option value="1935">1935</option>
			                                                     <option value="1934">1934</option>
			                                                     <option value="1933">1933</option>
			                                                     <option value="1932">1932</option>
			                                                     <option value="1931">1931</option>
			                                                     <option value="1930">1930</option>
			                                                     <option value="1929">1929</option>
			                                                     <option value="1928">1928</option>
			                                                     <option value="1927">1927</option>
			                                                     <option value="1926">1926</option>
			                                                     <option value="1925">1925</option>
			                                                     <option value="1924">1924</option>
			                                                     <option value="1923">1923</option>
			                                                     <option value="1922">1922</option>
			                                                     <option value="1921">1921</option>
			                                                     <option value="1920">1920</option>
			                                                     <option value="1919">1919</option>
			                                                     <option value="1918">1918</option>
			                                                     <option value="1917">1917</option>
			                                                     <option value="1916">1916</option>
			                                                     <option value="1915">1915</option>
			                                                     <option value="1914">1914</option>
			                                                     <option value="1913">1913</option>
			                                                     <option value="1912">1912</option>
			                                                     <option value="1911">1911</option>
			                                                     <option value="1910">1910</option>
			                                                     <option value="1909">1909</option>
			                                                     <option value="1908">1908</option>
			                                                     <option value="1907">1907</option>
			                                                     <option value="1906">1906</option>
			                                                     <option value="1905">1905</option>
			                                                     <option value="1904">1904</option>
			                                                     <option value="1903">1903</option>
			                                                     <option value="1902">1902</option>
			                                                     <option value="1901">1901</option>
			                                                     <option value="1900">1900</option>
			                                          </select>
			                                    </td>
			                                    <td class="outputError" id="alertBirthday">
			                                    </td>
			                                </tr>
			                                <tr>
			                                	<td class="label"><p class="labeltxt"><?php echo $this->text_address;?></p></td>
			                                	<td class="td_star"></td>
			                                    <td class="txtInput">
			                                    	<input type="text" name="txtAddress" id="txtAddress" size="35%" maxlength="50" class="input-text" value="<?php if(isset($this->address)) echo $this->address; ?>" />
			                                    </td>
			                                    <td class="outputError" id="alertAddress">
			                                    </td>
			                                </tr>
			                                <tr>
			                                	<td class="label"><p class="labeltxt"><?php echo $this->text_career;?></p></td>
			                                    <td></td>
			                                    <td class="txtInput">
			                                    	<input type="text" name="txtCareer" id="txtCareer" size="35%" maxlength="30" class="input-text" value="<?php if(isset($this->career)) echo $this->career; ?>" />
			                                    </td>
			                                    <td class="outputError">
			                                    </td>
			                                </tr>
			                        	</table>
								</div>
								<div class="fieldset" style="height:auto !important;">
									<h2 class="legend"><?php echo $this->text_lgcaptcha;?></h2>
									<table width="100%">
		                            	<tr>
		                                	<td class="label"><p class="labeltxt"><?php echo $this->text_captcha;?></p></td>
		                                	<td></td>
		                                    <td class="txtInput">
		                                    	<div style="width:160px; height:50px; float:left;">
		                                    	<a onclick="captcha()" style="cursor:pointer"><img id="captchaShow" src="<?php echo "/captcha/images/".$this->captchaID.".jpg"?>"/></a>
		                                    	</div><div style="width:28px; height:30px; float:left; margin-top:10px; margin-left:10px;">
		                                    	<input type="button" id="changeCaptcha" name="changeCaptcha" value="" onclick="captcha()" style="background:url(/images/ResetButton.png); width:28px; height:30px; border:0; cursor:pointer"/>
		                                    	</div>
		                                    </td>
		                                    <td class="outputError">
		                                    	<input type="hidden" id="hdnCaptcha" name="hdnCaptcha" value="<?php echo $this->captchaID?>" />
		                                    </td>
		                                </tr>
		                                <tr>
		                                	<td class="label"><p class="labeltxt"><?php echo $this->text_inputcaptcha;?></p></td>
		                                    <td class="td_star"><span class="star">*</span></td>
		                                    <td class="txtInput">
		                                    	<input type="text" name="txtCaptcha" id="txtCaptcha" size="35%" maxlength="20" class="input-text" />
		                                    </td>
		                                    <td class="outputError" id="alertCaptcha">
		                                    	<?php if(isset($this->captchaError)) echo $this->error_pass6;?>
		                                    </td>
		                                </tr>
		                            </table>
								</div>
								<div class="buttons-set">
									<p class="required"><?php echo $this->text_tip;?></p>
									<p class="back-link"><a href="/"><small>« </small><?php echo $this->text_cancel;?></a></p>
									<button type="submit" title="<?php echo $this->text_submit;?>" class="button"><span><span><?php echo $this->text_submit;?></span></span></button>
								</div>
								</form>
								
						</div>
					</div>
					<!-- end center -->
		
	<?php 	}
		else 
		{?>
<link rel="stylesheet" type="text/css" href="/css/userStyle.css" />
				<p><?php echo $this->text_title_register;?></p>
				<div class="line"><hr></div>
				<br />
                <div id="contentUser">
                	<i class="guide"><?php echo $this->text_tip;?></i>
                	<form id="frmRegister" name="frmRegister" action="" method="POST" enctype="multipart/form-data" onsubmit="return checkinput()">
                    	<div id="contentUser_1">
                    	<fieldset style="width:650px">
                        	<legend><span class="nameInformation"><b><?php echo $this->text_lguser;?></b></span></legend>
                            <table width="650px">
                            	<tr>
                                	<td class="label"><p class="labeltxt"><?php echo $this->text_username;?></p></td>
                                    <td class="td_star"><span class="star">*</span></td>
                                    <td class="txtInput">
                                    	<input type="text" name="txtUsername" id="txtUsername" size="20" maxlength="30" style="width:auto !important;" class="input" value="<?php if(isset($this->username)) echo $this->username; ?>" />
                                    	<input type="button" id="checkUsername" name="checkUsername" value="Kiểm tra" onclick="validateUser()" style="background:url(/images/btn_short.png) no-repeat; width:60px; height:30px; border:0; cursor:pointer; margin-left:2px; font-family:Arial, Helvetica, sans-serif; font-size:12px;color:white;"/>
                                    </td>
                                    <td class="outputError" id="alertUser">
                                    	<?php //if(isset($this->userError))echo $this->error_validuser1;?>
                                    </td>
                        		</tr>
                        		<tr>
                        			<td></td><td></td>
                        			<td colspan="2" class="outputTip">
                        				<!-- <ul>
                        					<li>- Tên đăng nhập có từ 4 đến 30 ký tự, viết liền, không dấu.</li>
                        					<li>- Tên đăng nhập chỉ được dùng các chữ cái, chữ số hoặc gạch dưới.</li>
                        				</ul> -->
                        			</td>
                        		</tr>
                                <tr>
                                	<td class="label"><p class="labeltxt"><?php echo $this->text_pass;?></p></td>
                                    <td class="td_star"><span class="star">*</span></td>
                                    <td class="txtInput">
                                    	<input type="password" name="txtPassword" id="txtPassword" size="20" maxlength="30" class="input"/>
                                    </td>
                                    <td class="outputError" id="alertPassword">
                                    </td>
                                </tr>
                                <tr>
                        			<td></td><td></td>
                        			<td colspan="2" class="outputTip">
                        				<!-- <ul>
                        					<li>- Mật khẩu phải có ít nhất 6 ký tự.</li>
                        					<li>- Mật khẩu không được viết Tiếng Việt có dấu.</li>
                        					<li>- Mật khẩu có thể dùng các chữ cái, chữ số, các ký tự đặc biệt.</li>
                        				</ul> -->
                        			</td>
                        		</tr>
                                <tr>
                                	<td class="label"><p class="labeltxt"><?php echo $this->text_confirmpass;?></p></td>
                                    <td class="td_star"><span class="star">*</span></td>
                                    <td class="txtInput">
                                    	<input type="password" name="txtConfirmPassword" id="txtConfirmPassword" size="20" maxlength="30" class="input"/>
                                    </td>
                                    <td class="outputError" id="alertConfirmPass">
                                    </td>
                                </tr>
                                
                        	</table>
                        </fieldset>
                        </div>
                        
                        <div id="contentUser_2">
                        <fieldset style="width:650px">
                        	<legend><span class="nameInformation"><b><?php echo $this->text_lgprofile;?></b></span></legend>
                            <table width="650px">
                            	<tr>
                                	<td class="label"><p class="labeltxt"><?php echo $this->text_name;?></p></td>
                                    <td class="td_star"><span class="star">*</span></td>
                                    <td class="txtInput">
                                    	<input type="text" name="txtFullName" id="txtFullName" maxlength="30" class="input" value="<?php if(isset($this->fullname)) echo $this->fullname; ?>" />
                                    </td>
                                    <td class="outputError" id="alertFullName">
                                    </td>
                        		</tr>
                        		<tr>
                                	<td class="label"><p class="labeltxt"><?php echo $this->text_email;?></p></td>
                                    <td class="td_star"><span class="star">*</span></td>
                                    <td class="txtInput">
                                    	<input type="text" name="txtEmail" id="txtEmail" size="30" maxlength="120" class="input" value="<?php if(isset($this->email)) echo $this->email; ?>" />
                                    </td>
                                    <td class="outputError" id="alertEmail">
                                    	<?php if(isset($this->emailError)) echo $this->error_validuser3;?>
                                    </td>
                        		</tr>
                                <tr>
                                	<td class="label"><p class="labeltxt"><?php echo $this->text_comfirmemail;?></p></td>
                                    <td class="td_star"><span class="star">*</span></td>
                                    <td class="txtInput">
                                    	<input type="text" name="txtConfirmEmail" id="txtConfirmEmail" maxlength="120" class="input" value="<?php if(isset($this->email)) echo $this->email; ?>" />
                                    </td>
                                    <td class="outputError" id="alertConfirmEmail">
                                    </td>
                        		</tr>
                                <tr>
                                	<td class="label"><p class="labeltxt"><?php echo $this->text_sex;?></p></td>
                                    <td class="td_star"><span class="star">*</span></td>
                                    <td class="txtInput">
                                    	<select id="sltSex" name="sltSex" tabindex="0" >
                                         		<option <?php if(!isset($this->sex)) echo "selected='selected'"?> value="-1"><?php echo $this->text_select;?></option>
                                                <option <?php if(isset($this->sex) && $this->sex == 1) echo "selected='selected'"?> value="1"><?php echo $this->text_sex1;?></option>
                                                <option <?php if(isset($this->sex) && $this->sex == 0) echo "selected='selected'"?> value="0"><?php echo $this->text_sex0;?></option>
                                         </select>
                                    </td>
                                    <td class="outputError" id="alertSex">
                                    </td>
                                </tr>
                                <tr>
                                	<td class="label"><p class="labeltxt"><?php echo $this->text_birthday;?></p></td>
                                    <td class="td_star"><span class="star">*</span></td>
                                    <td class="txtInput">
                                    	<select id="dBirthday" name="dBirthday" tabindex="0" class="select">
                                         			<option <?php if(!isset($this->dbirthday)) echo "selected='selected'"?> value="0"><?php echo $this->text_day;?></option>
                                         			<?php if(isset($this->dbirthday) && $this->dbirthday>0) echo "<option selected='selected' value='{$this->dbirthday}'>{$this->dbirthday}</option>"?>
                                                     <option value="1">1</option>
                                                     <option value="2">2</option>
                                                     <option value="3">3</option>
                                                     <option value="4">4</option>
                                                     <option value="5">5</option>
                                                     <option value="6">6</option>
                                                     <option value="7">7</option>
                                                     <option value="8">8</option>
                                                     <option value="9">9</option>
                                                     <option value="10">10</option>
                                                     <option value="11">11</option>
                                                     <option value="12">12</option>
                                                     <option value="13">13</option>
                                                     <option value="14">14</option>
                                                     <option value="15">15</option>
                                                     <option value="16">16</option>
                                                     <option value="17">17</option>
                                                     <option value="18">18</option>
                                                     <option value="19">19</option>
                                                     <option value="20">20</option>
                                                     <option value="21">21</option>
                                                     <option value="22">22</option>
                                                     <option value="23">23</option>
                                                     <option value="24">24</option>
                                                     <option value="25">25</option>
                                                     <option value="26">26</option>
                                                     <option value="27">27</option>
                                                     <option value="28">28</option>
                                                     <option value="29">29</option>
                                                     <option value="30">30</option>
                                                     <option value="31">31</option>
                                         </select>
                                         <select id="mBirthday" name="mBirthday" tabindex="0" >
                                         		<option <?php if(!isset($this->mbirthday)) echo "selected='selected'"?> value="0"><?php echo $this->text_month;?></option>
                                         		<?php if(isset($this->mbirthday) && $this->mbirthday>0) echo "<option selected='selected' value='{$this->mbirthday}'>{$this->mbirthday}</option>"?>
                                                 <option value="1">1</option>
                                                 <option value="2">2</option>
                                                 <option value="3">3</option>
                                                 <option value="4">4</option>
                                                 <option value="5">5</option>
                                                 <option value="6">6</option>
                                                 <option value="7">7</option>
                                                 <option value="8">8</option>
                                                 <option value="9">9</option>
                                                 <option value="10">10</option>
                                                 <option value="11">11</option>
                                                 <option value="12">12</option>
                                         </select>
                                         <select id="yBirthday" name="yBirthday" tabindex="0" class="select">
                                         			<option <?php if(!isset($this->ybirthday)) echo "selected='selected'"?> value="0"><?php echo $this->text_year;?></option>
                                         			<?php if(isset($this->ybirthday) && $this->ybirthday>0) echo "<option selected='selected' value='{$this->ybirthday}'>{$this->ybirthday}</option>"?>
                                                     <option value="2011">2011</option>
                                                     <option value="2010">2010</option>
                                                     <option value="2009">2009</option>
                                                     <option value="2008">2008</option>
                                                     <option value="2007">2007</option>
                                                     <option value="2006">2006</option>
                                                     <option value="2005">2005</option>
                                                     <option value="2004">2004</option>
                                                     <option value="2003">2003</option>
                                                     <option value="2002">2002</option>
                                                     <option value="2001">2001</option>
                                                     <option value="2000">2000</option>
                                                     <option value="1999">1999</option>
                                                     <option value="1998">1998</option>
                                                     <option value="1997">1997</option>
                                                     <option value="1996">1996</option>
                                                     <option value="1995">1995</option>
                                                     <option value="1994">1994</option>
                                                     <option value="1993">1993</option>
                                                     <option value="1992">1992</option>
                                                     <option value="1991">1991</option>
                                                     <option value="1990">1990</option>
                                                     <option value="1989">1989</option>
                                                     <option value="1988">1988</option>
                                                     <option value="1987">1987</option>
                                                     <option value="1986">1986</option>
                                                     <option value="1985">1985</option>
                                                     <option value="1984">1984</option>
                                                     <option value="1983">1983</option>
                                                     <option value="1982">1982</option>
                                                     <option value="1981">1981</option>
                                                     <option value="1980">1980</option>
                                                     <option value="1979">1979</option>
                                                     <option value="1978">1978</option>
                                                     <option value="1977">1977</option>
                                                     <option value="1976">1976</option>
                                                     <option value="1975">1975</option>
                                                     <option value="1974">1974</option>
                                                     <option value="1973">1973</option>
                                                     <option value="1972">1972</option>
                                                     <option value="1971">1971</option>
                                                     <option value="1970">1970</option>
                                                     <option value="1969">1969</option>
                                                     <option value="1968">1968</option>
                                                     <option value="1967">1967</option>
                                                     <option value="1966">1966</option>
                                                     <option value="1965">1965</option>
                                                     <option value="1964">1964</option>
                                                     <option value="1963">1963</option>
                                                     <option value="1962">1962</option>
                                                     <option value="1961">1961</option>
                                                     <option value="1960">1960</option>
                                                     <option value="1959">1959</option>
                                                     <option value="1958">1958</option>
                                                     <option value="1957">1957</option>
                                                     <option value="1956">1956</option>
                                                     <option value="1955">1955</option>
                                                     <option value="1954">1954</option>
                                                     <option value="1953">1953</option>
                                                     <option value="1952">1952</option>
                                                     <option value="1951">1951</option>
                                                     <option value="1950">1950</option>
                                                     <option value="1949">1949</option>
                                                     <option value="1948">1948</option>
                                                     <option value="1947">1947</option>
                                                     <option value="1946">1946</option>
                                                     <option value="1945">1945</option>
                                                     <option value="1944">1944</option>
                                                     <option value="1943">1943</option>
                                                     <option value="1942">1942</option>
                                                     <option value="1941">1941</option>
                                                     <option value="1940">1940</option>
                                                     <option value="1939">1939</option>
                                                     <option value="1938">1938</option>
                                                     <option value="1937">1937</option>
                                                     <option value="1936">1936</option>
                                                     <option value="1935">1935</option>
                                                     <option value="1934">1934</option>
                                                     <option value="1933">1933</option>
                                                     <option value="1932">1932</option>
                                                     <option value="1931">1931</option>
                                                     <option value="1930">1930</option>
                                                     <option value="1929">1929</option>
                                                     <option value="1928">1928</option>
                                                     <option value="1927">1927</option>
                                                     <option value="1926">1926</option>
                                                     <option value="1925">1925</option>
                                                     <option value="1924">1924</option>
                                                     <option value="1923">1923</option>
                                                     <option value="1922">1922</option>
                                                     <option value="1921">1921</option>
                                                     <option value="1920">1920</option>
                                                     <option value="1919">1919</option>
                                                     <option value="1918">1918</option>
                                                     <option value="1917">1917</option>
                                                     <option value="1916">1916</option>
                                                     <option value="1915">1915</option>
                                                     <option value="1914">1914</option>
                                                     <option value="1913">1913</option>
                                                     <option value="1912">1912</option>
                                                     <option value="1911">1911</option>
                                                     <option value="1910">1910</option>
                                                     <option value="1909">1909</option>
                                                     <option value="1908">1908</option>
                                                     <option value="1907">1907</option>
                                                     <option value="1906">1906</option>
                                                     <option value="1905">1905</option>
                                                     <option value="1904">1904</option>
                                                     <option value="1903">1903</option>
                                                     <option value="1902">1902</option>
                                                     <option value="1901">1901</option>
                                                     <option value="1900">1900</option>
                                          </select>
                                    </td>
                                    <td class="outputError" id="alertBirthday">
                                    </td>
                                </tr>
                                <tr>
                                	<td class="label"><p class="labeltxt"><?php echo $this->text_address;?></p></td>
                                	<td class="td_star"></td>
                                    <td class="txtInput">
                                    	<input type="text" name="txtAddress" id="txtAddress" maxlength="50" class="input" value="<?php if(isset($this->address)) echo $this->address; ?>" />
                                    </td>
                                    <td class="outputError" id="alertAddress">
                                    </td>
                                </tr>
                                <tr>
                                	<td class="label"><p class="labeltxt"><?php echo $this->text_career;?></p></td>
                                    <td></td>
                                    <td class="txtInput">
                                    	<input type="text" name="txtCareer" id="txtCareer" maxlength="30" class="input" value="<?php if(isset($this->career)) echo $this->career; ?>" />
                                    </td>
                                    <td class="outputError">
                                    </td>
                                </tr>
                        	</table>
                        </fieldset>
                        </div>
                        <div id="contentUser_3">
                        <fieldset style="width:650px">
                        	<legend><span class="nameInformation"><b><?php echo $this->text_lgcaptcha;?></b></span></legend>
                            <table width="650px">
                            	<tr>
                                	<td class="label"><p class="labeltxt"><?php echo $this->text_captcha;?></p></td>
                                	<td></td>
                                    <td class="txtInput">
                                    	<div style="width:160px; height:50px; float:left;">
                                    	<a onclick="captcha()" style="cursor:pointer"><img id="captchaShow" src="<?php echo "/captcha/images/".$this->captchaID.".jpg"?>"/></a>
                                    	</div><div style="width:28px; height:30px; float:left; margin-top:10px; margin-left:10px;">
                                    	<input type="button" id="changeCaptcha" name="changeCaptcha" value="" onclick="captcha()" style="background:url(/images/ResetButton.png); width:28px; height:30px; border:0; cursor:pointer"/>
                                    	</div>
                                    </td>
                                    <td class="outputError">
                                    	<input type="hidden" id="hdnCaptcha" name="hdnCaptcha" value="<?php echo $this->captchaID?>" />
                                    </td>
                                </tr>
                                <tr>
                        			<td></td><td></td>
                        			<td colspan="2" class="outputTip">
                        				<!-- <ul>
                        					<li>- Hãy nhập lại mã xác nhận vào bên dưới.</li>
                        					<li>- Không phân biệt HOA/thường.</li>
                        				</ul> -->
                        			</td>
                        		</tr>
                                <tr>
                                	<td class="label"><p class="labeltxt"><?php echo $this->text_inputcaptcha;?></p></td>
                                    <td class="td_star"><span class="star">*</span></td>
                                    <td class="txtInput">
                                    	<input type="text" name="txtCaptcha" id="txtCaptcha" size="20" maxlength="20" class="input" />
                                    </td>
                                    <td class="outputError" id="alertCaptcha">
                                    	<?php if(isset($this->captchaError)) echo $this->error_pass6;?>
                                    </td>
                                </tr>
                            </table>
                        </fieldset>
                        </div>
                        <div id="contentUser_4">
                        	<table width="100%">
                        		<tr>
                        			<td colspan="2" style="text-align:left">
                        				<!-- <span id="agree">Bằng việc nhấn vào "Đăng ký" là bạn đã đồng ý với các điều khoản của chúng tôi.</span> -->
                        			</td>
                        		</tr>
                        		
                        		<tr>
                        			<td width="50%" style="text-align:center">
                            			<input type="submit" id="createUser" name="createUser" value="<?php echo $this->text_submit;?>" class="btnUser" />
                            		</td>
                            		<td width="50%" style="text-align:center">
                            			<input type="button" id="resetForm" name="resetForm" value="<?php echo $this->text_cancel;?>" class="btnUser" onclick="resetform()"/>
                            		</td>
                            	</tr>
                            </table>
                        </div>
                    </form>
         </div>            
                    
<?php }
	}
}?>
                    <script type="text/javascript">
                    function checkUser()
                    {
                    	var user = document.frmRegister.txtUsername.value;
                    	if(user.length<4 || user.length>30)
                    	{
                    		document.getElementById("alertUser").innerHTML="<?php echo $this->error_account1;?>";
                    		document.getElementById("alertUser").style.color="red";
                    		document.frmRegister.txtUsername.focus();
                    		return false;
                    	}
                    	/*if(user.charCodeAt(0)<48 || user.charCodeAt(0)>57 && user.charCodeAt(0)<65 || user.charCodeAt(0)>90 && user.charCodeAt(0)<97 || user.charCodeAt(0)>122)
                    	{
                    		document.getElementById("alertUser").innerHTML="Tên đăng nhập phải bắt đầu bằng chữ cái hoặc số";
                    		document.frmRegister.txtUsername.focus();
                    		return false;
                    	}
                    	if(user.charCodeAt(user.length-1)<48 || user.charCodeAt(user.length-1)>57 && user.charCodeAt(user.length-1)<65 || user.charCodeAt(user.length-1)>90 && user.charCodeAt(user.length-1)<97 || user.charCodeAt(user.length-1)>122)
                    	{
                    		document.getElementById("alertUser").innerHTML="Tên đăng nhập phải kết thúc bằng chữ cái, số, dấu chấm hoặc gạch dưới";
                    		document.frmRegister.txtUsername.focus();
                    		return false;
                    	}*/
                    	for(var i=0; i<user.length; i++)
                    	{
                    		if(user.charCodeAt(i)<48 || (user.charCodeAt(i)>57 && user.charCodeAt(i)<65) || (user.charCodeAt(i)>90 && user.charCodeAt(i)<95) || user.charCodeAt(i)==96 || user.charCodeAt(i)>122)
                    		{
                    			document.getElementById("alertUser").innerHTML="<?php echo $this->error_account2;?>";
                    			document.getElementById("alertUser").style.color="red";
                    			document.frmRegister.txtUsername.focus();
                    			return false;
                    		}
                    	}
                    	document.getElementById("alertUser").innerHTML="";
                    	return true;
                    }

                    function checkPassword()
                    {
                    	var pass = document.frmRegister.txtPassword.value;
                    	var confirmPass = document.frmRegister.txtConfirmPassword.value;
                    	if(pass.length<6)
                    	{
                    		document.getElementById("alertPassword").innerHTML="<?php echo $this->error_pass1;?>";
                    		document.frmRegister.txtPassword.focus();
                    		document.getElementById("alertConfirmPass").innerHTML="";
                    		return false;
                    	}
                    	for(var i=0; i<pass.length; i++)
                    	{
                    		if(pass.charCodeAt(i)<32 || pass.charCodeAt(i)>126)
                    		{
                    			document.getElementById("alertPassword").innerHTML="<?php echo $this->error_pass2;?>";
                    			document.frmRegister.txtPassword.focus();
                    			document.getElementById("alertConfirmPass").innerHTML="";
                    			return false;
                    		}
                    	}
                    	if(pass!=confirmPass)
                    	{
                    		document.getElementById("alertConfirmPass").innerHTML="<?php echo $this->error_pass3;?>";
                    		document.frmRegister.txtConfirmPassword.focus();
                    		document.getElementById("alertPassword").innerHTML="";
                    		return false;
                    	}
                    	document.getElementById("alertPassword").innerHTML="";
                    	document.getElementById("alertConfirmPass").innerHTML="";
                    	return true;
                    }

                    function checkFullName()
                    {
                    	var fullName = document.frmRegister.txtFullName.value;
                    	if(fullName.length<4 || fullName.length>30)
                    	{
                    		document.getElementById("alertFullName").innerHTML="<?php echo $this->error_profile1;?>";
                    		document.frmRegister.txtFullName.focus();
                    		return false;
                    	}
                    	document.getElementById("alertFullName").innerHTML="";
                    	return true;
                    }

                    function checkSex()
                    {
                    	var sex = document.frmRegister.sltSex.value;
                    	if(sex==-1)
                    	{
                    		document.getElementById("alertSex").innerHTML="<?php echo $this->error_profile2;?>";
                    		document.frmRegister.sltSex.focus();
                    		return false;
                    	}
                    	document.getElementById("alertSex").innerHTML="";
                    	return true;
                    }

                    function checkBirthday()
                    {
                    	var d = document.frmRegister.dBirthday.value;
                    	var m = document.frmRegister.mBirthday.value;
                    	var y = document.frmRegister.yBirthday.value;
                    	if(d==0||m==0||y==0)
                    	{
                    		document.getElementById("alertBirthday").innerHTML="<?php echo $this->error_profile3;?>";
                    		document.frmRegister.dBirthday.focus();
                    		return false;
                    	}
                    	if((m==4||m==6||m==9||m==11)&&d==31)
                    	{
                    		document.getElementById("alertBirthday").innerHTML="<?php echo $this->error_profile4;?>";
                    		document.frmRegister.dBirthday.focus();
                    		return false;
                    	}
                    	if(m==2)
                    	{
                    		if(d>29)
                    		{
                    			document.getElementById("alertBirthday").innerHTML="<?php echo $this->error_profile4;?>";
                    			document.frmRegister.dBirthday.focus();
                    			return false;
                    		}
                    		if(!isLeapYear(y) && d==29)
                    		{
                    			document.getElementById("alertBirthday").innerHTML="<?php echo $this->error_profile4;?>";
                    			document.frmRegister.dBirthday.focus();
                    			return false;
                    		}
                    	}
                    	document.getElementById("alertBirthday").innerHTML="";
                    	return true;
                    }

                    function checkEmail()
                    {
                    	var email = document.getElementById("txtEmail").value;
                    	var confirmEmail = document.getElementById("txtConfirmEmail").value;
                    	var regEmail = /^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,3})+$/;
                    	if(email.length==0)
                    	{
                    		document.getElementById("alertConfirmEmail").innerHTML="";
                    		document.getElementById("alertEmail").innerHTML="<?php echo $this->error_profile5;?>";
                    		document.frmRegister.txtEmail.focus();
                    		return false;
                    	}
                    	if(regEmail.test(email)==false)
                    	{
                    		document.getElementById("alertConfirmEmail").innerHTML="";
                    		document.getElementById("alertEmail").innerHTML="<?php echo $this->error_profile6;?>";
                    		document.frmRegister.txtEmail.focus();
                    		return false;
                    	}
                    	if(confirmEmail!=email)
                    	{
                    		document.getElementById("alertEmail").innerHTML="";
                    		document.getElementById("alertConfirmEmail").innerHTML="<?php echo $this->error_profile7;?>";
                    		document.frmRegister.txtConfirmEmail.focus();
                    		return false;
                    	}
                    	document.getElementById("alertEmail").innerHTML="";
                    	document.getElementById("alertConfirmEmail").innerHTML="";
                    	return true;
                    }

                    function checkCaptcha()
                    {
                    	var captcha = document.getElementById("txtCaptcha").value;
                    	if(captcha==""||captcha==null||captcha.length==0)
                    	{
                    		document.getElementById("alertCaptcha").innerHTML="<?php echo $this->error_profile8;?>";
                    		document.frmRegister.txtCaptcha.focus();
                    		return false;
                    	}
                    	document.getElementById("alertCaptcha").innerHTML="";
                    	return true;
                    }

                    function checkinput()
                    {
                    	if(!checkUser())
                    		return false;
                    	if(!checkPassword())
                    		return false;
                    	if(!checkFullName())
                    		return false;
                    	if(!checkEmail())
                    		return false;
                    	if(!checkSex())
                    		return false;
                    	if(!checkBirthday())
                    		return false;
                    	if(!checkCaptcha())
                    		return false;
                    	return true;
                    }

                    function resetform()
                    {
                    	document.frmRegister.reset();
                    	document.frmRegister.txtUsername.value="";
                    	document.frmRegister.txtFullName.value="";
                    	document.frmRegister.txtEmail.value="";
                    	document.getElementById("alertUser").innerHTML="";
                    	document.getElementById("alertPass").innerHTML="";
                    	document.getElementById("alertConfirmPass").innerHTML="";
                    	document.getElementById("alertFullName").innerHTML="";
                    	document.getElementById("alertSex").innerHTML="";
                    	document.getElementById("alertBirthday").innerHTML="";
                    	document.getElementById("alertEmail").innerHTML="";
                    	document.getElementById("alertConfirmEmail").innerHTML="";
                    	document.getElementById("alertCaptcha").innerHTML="";
                    	document.frmRegister.txtUsername.focus();
                    }

                    function isLeapYear(year)
                    {
                    	return new Date(year, 2, 0).getDate() > 28;
                    }

                    function validateUser()
                    {
                    	if(checkUser())
                    	{
                    		var user = document.frmRegister.txtUsername.value;
                    		if (window.XMLHttpRequest)
                    		{// code for IE7+, Firefox, Chrome, Opera, Safari
                    			xmlhttp=new XMLHttpRequest();
                    		}
                    		else
                    		{// code for IE6, IE5
                    			xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
                    		}
                    		xmlhttp.onreadystatechange=function()
                    		{
                    			if (xmlhttp.readyState==4 && xmlhttp.status==200)
                    			{
                    				var str = xmlhttp.responseText;
                    				if (str == 0){
                    					document.getElementById("alertUser").innerHTML = "<?php echo $this->error_validuser1;?>";
                    					document.getElementById("alertUser").style.color="red";
                    				}
                    				if (str == 1){
                    					document.getElementById("alertUser").innerHTML = "<?php echo $this->error_validuser2;?>";
                    					document.getElementById("alertUser").style.color="green";
                    				}
                    			}
                    		}
                    		xmlhttp.open("GET","/register/index?username="+user,true);
                    		xmlhttp.send();
                    	}
                    }

                    function captcha()
                    {
                    	var user = document.frmRegister.txtUsername.value;
                    	if (window.XMLHttpRequest)
                    	{// code for IE7+, Firefox, Chrome, Opera, Safari
                    		xmlhttp=new XMLHttpRequest();
                    	}
                    	else
                    	{// code for IE6, IE5
                    		xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
                    	}
                    	xmlhttp.onreadystatechange=function()
                    	{
                    		if (xmlhttp.readyState==4 && xmlhttp.status==200)
                    		{
                    			var link = xmlhttp.responseText;
                    			var str = link.replace(/"/g,"");
                    			document.getElementById("captchaShow").src = "/captcha/images/"+str+".jpg";
                    			document.getElementById("hdnCaptcha").value = str;
                    		}
                    	}
                    	xmlhttp.open("GET","/contactform/contact/index?captcha",true);
                    	xmlhttp.send();
                    }
                                        
                    </script>
                
			
			<div style="clear: both;"></div>